home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 8
/
Night Owl CD-ROM (NOPV8) (Night Owl Publisher) (1993).ISO
/
034a
/
aecur101.arj
/
CONTRIB
/
CURSES
/
SRC
/
MATCHKEY.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-03-08
|
560b
|
29 lines
/*------------------------------------------------------------
*
* matchkey.c
*
* copyright (c) 1988,89,90 J. Alan Eldridge
*
* since keys are ints, we can't use strchr() to
* see if a key is in an array of keys
*
* the array is terminated with K_ILLEGAL
*
*----------------------------------------------------------*/
#include "curses.h"
int
kb_matchkey(arr, val)
int *arr;
int val;
{
int n;
for (n = 0; *arr != K_ILLEGAL; arr++, n++)
if (*arr == val)
return n;
return -1;
}